﻿<UserControl xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  x:Class="SL.WorkfowDesigner.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1024"
    xmlns:localUtil="clr-namespace:SL.WorkfowDesigner.Utilities" Loaded="MainPage_OnLoaded">
    <UserControl.Resources>
        <ResourceDictionary>
            <localUtil:VisibilityConverter x:Key="Visibility_Converter" ></localUtil:VisibilityConverter>
        </ResourceDictionary>
    </UserControl.Resources>
    <Border BorderThickness="2" BorderBrush="CornflowerBlue"  CornerRadius="5">
        <Grid x:Name="LayoutRoot" Background="White" LayoutUpdated="LayoutRoot_OnLayoutUpdated">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border BorderThickness="1" BorderBrush="Black" CornerRadius="3" Grid.Row="0" Grid.ColumnSpan="2">
                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal"  VerticalAlignment="Center">
                </StackPanel>
            </Border>
            <Border BorderThickness="1" BorderBrush="Black" CornerRadius="3" Grid.Row="1" Grid.Column="0">
                <toolkit:Accordion HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <toolkit:Accordion.ItemContainerStyle>
                        <Style TargetType="toolkit:AccordionItem">
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                        </Style>
                    </toolkit:Accordion.ItemContainerStyle>
                    <toolkit:AccordionItem Name="accordion1" Header="Basic Sharp">
                        <StackPanel>
                            <ListBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  >
                                <ListBox.ItemContainerStyle>
                                    <Style TargetType="ListBoxItem">
                                        <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
                                    </Style>
                                </ListBox.ItemContainerStyle>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10"  ></Image>
                                <Image Source="Images/Item1.png" Width="58"  Margin="50,10,50,10" ></Image>
                            </ListBox>
                        </StackPanel>
                    </toolkit:AccordionItem>
                    <toolkit:AccordionItem Header="Flow" Content="World" />
                    <toolkit:AccordionItem Header="Event" Content="World" />
                    <toolkit:AccordionItem Header="Task" Content="World" />
                </toolkit:Accordion>
            </Border>
            <ScrollViewer x:Name="FreeLayoutScrollViewer" Grid.Row="1" Grid.Column="1"  
                          ScrollViewer.VerticalScrollBarVisibility="Auto"  
                          ScrollViewer.HorizontalScrollBarVisibility="Auto" Background="SkyBlue">
                <toolkit:LayoutTransformer x:Name="layoutTransform"  >
                    <toolkit:LayoutTransformer.LayoutTransform>
                        <TransformGroup>
                            <ScaleTransform x:Name="scaleTransform" CenterX="0" CenterY="0"/>
                        </TransformGroup>
                    </toolkit:LayoutTransformer.LayoutTransform>
                    <toolkit:LayoutTransformer.Content>
                        <Grid x:Name="FreeLayout" AllowDrop="True"  LayoutUpdated="FreeLayout_OnLayoutUpdated" Width="800" Height="600">
                        </Grid>
                    </toolkit:LayoutTransformer.Content>
                </toolkit:LayoutTransformer>
            </ScrollViewer>
            <Border BorderThickness="1" BorderBrush="Black" CornerRadius="3" Grid.Row="2" Grid.ColumnSpan="2">
                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal"  VerticalAlignment="Center">
                    <TextBlock Margin="5,0,5,0"  Text="Zooming:"></TextBlock>
                    <Slider Name="silderZoom" Margin="5,0,5,0" Width="500" Minimum="20" Maximum="500" Value="{Binding ZoomLevelValue,Mode=TwoWay}" ValueChanged="silderZoom_OnValueChanged" ></Slider>
                    <TextBlock Text="{Binding ZoomLevelValue,Mode=OneWay}"></TextBlock>
                    <TextBlock Text="%"></TextBlock>
                    <Button Name="btnReset" Content="Reset" Padding="5,0,5,0" Margin="5,0,5,0" Click="btnReset_OnClick"></Button>
                    <CheckBox Padding="5,0,5,0" Margin="5,0,5,0" IsChecked="{Binding ShowGridLines,Mode=TwoWay}" Content="Grid Visiblity"></CheckBox>
                    <CheckBox Name="chkEnablePanZoom" Padding="5,0,5,0" Margin="5,0,5,0" IsChecked="{Binding EnablePanZoom,Mode=TwoWay}" Content="Enable Pan Zoom" Click="chkEnablePanZoom_Click"></CheckBox>
                    <Button Name="btnAdd" Content="Add" Padding="5,0,5,0" Margin="5,0,5,0" Click="btnAdd_OnClick"></Button>
                    <Button Name="btnDownload" Content="Download" Padding="5,0,5,0" Margin="5,0,5,0" Click="btnDownload_OnClick"></Button>
                    <Button Name="btnPrint" Content="Print" Padding="5,0,5,0" Margin="5,0,5,0" Click="btnPrint_OnClick"></Button>
                </StackPanel>
            </Border>
        </Grid>
    </Border>
</UserControl>
